<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            height: 100vh;
        }

        div {
            float: left;
            width: 10px;
            height: 10px;
        }
    </style>
</head>

<body>
</body>
<script>
    var body = document.body;

    function getColor() {
        var color = '#';
        for (let i = 0; i < 6; i++) {
            var c = Math.ceil(Math.random() * 15).toString(16);
            color += c;
        }
        return color;
    }

    function start() {
        body.innerHTML = '';
        for (let i = 0; i < 5000; i++) {
            var div = document.createElement('div');
            div.style.backgroundColor = getColor();
            body.appendChild(div);
        }
    }

    body.onclick = function () {
        start();
    }
</script>

</html>